class EditorMenuWidget extends Composite implements EditorMenuView {

  private final ContentPanel mainPanel = new ContentPanel();

  private final Button newTaskButton = new Button();

  private final Button openTaskButton = new Button();

  private final Button saveTaskButton = new Button();
	
  public EditorMenuWidget() {
    initComposite();
    initI18n();
    initLayout();
    initComponent(mainPanel);
	}

  @Override
  public void blockSaveTask() {
    saveTaskButton.setEnabled(false);
  }

  @Override
  public void setNewTaskBehavior(final Behavior behavior) {
    newTaskButton.addSelectionListener(new SelectionListener<ButtonEvent>() {

      @Override
      public void componentSelected(ButtonEvent ce) {
        behavior.behave();
      }
    });
  }

  @Override
  public void setOpenTaskBehavior(final Behavior behavior) {
    openTaskButton.addSelectionListener(new SelectionListener<ButtonEvent>() {

      @Override
      public void componentSelected(ButtonEvent ce) {
        behavior.behave();
      }
    });
  }

  @Override
  public void setSaveTaskBehavior(final Behavior behavior) {
    saveTaskButton.addSelectionListener(new SelectionListener<ButtonEvent>() {

      @Override
      public void componentSelected(ButtonEvent ce) {
        behavior.behave();
      }
    });
  }

  @Override
  public void unblockSaveTask() {
    saveTaskButton.setEnabled(true);
  }

	// Metody prywatne.
}
